/*****************************************************************************
 *
 * Copyright (c), 2004-2020,ShangHai Neotune Information Technology Co., Ltd.
 *
 * Module Name : v3_con.h
 *
 * Author :    sean
 *
 * Date :    2004-02-05
 *
 * Version :    1.00
 *
 * Description :    
 *
 * Other :    
 *
 * Data Structure List: <Main Data Structure>
 *
 * Modification History
 * ---------------------------------------------------------------------------
 *  1: Data :      2004-02-05
 *    Author :     sean
 *    Version :    V100R001M00
 *    Modification : creation
 *
*****************************************************************************/


#if (!defined(v3_context_inc))
#define v3_context_inc

#ifdef __cplusplus
extern"C" {
#endif

#if (!defined(asn1_inc))
#include <asn1.h>
#endif

#define ETC_CONTEXT_MAX 32

#ifdef NEOSNET_STRUCT_ALIGN
#pragma align 1
#endif

typedef struct SNMP_CONTEXT_S
        {
        struct SNMP_CONTEXT_S *next;
        bits8_t               *name;
        ALENGTH_T              length;
        } SNMP_CONTEXT_T;

#ifdef NEOSNET_STRUCT_ALIGN
#pragma align 0
#endif

extern SNMP_CONTEXT_T *v3_context_root;

extern int             SNMP_V3_Context_Add    __((bits8_t *, ALENGTH_T));
extern int             SNMP_V3_Context_Remove __((bits8_t *, ALENGTH_T));
extern SNMP_CONTEXT_T *SNMP_V3_Context_Find   __((bits8_t *, ALENGTH_T));

#define SNMP_V3_Context_Name(C)        ((C)->name)
#define SNMP_V3_Context_Name_Length(C) ((C)->length)

extern void contexttable_get  __((OIDC_T, int, OIDC_T *,
                                  SNMP_PKT_T *, VB_T *));

extern void contexttable_next  __((OIDC_T, int, OIDC_T *,
                                   SNMP_PKT_T *, VB_T *));

#ifdef __cplusplus
}
#endif

#endif /* v3_context_inc */
